<?php 
@session_start();
include "../include/config.php";
include "../include/db.php";

$query = "SELECT id_rep_dep FROM vw_motivo_rep_dep GROUP BY id_rep_dep";
$result = mysql_query($query) or trigger_error(mysql_error());

while ($row = mysql_fetch_array($result)) {
	$query2 = "INSERT INTO vw_motivo_rep_dep 
			 (id_rep_dep, motivo, usr_alta, fecha_alta) 
			 VALUES 
			 ({$row['id_rep_dep']}, 'Correspondencia', 'rlevano', now()) ";
				
	$result2 = mysql_query($query2) or trigger_error(mysql_error());
}

echo "LISTO";

?>